package com.wellsantos.dgwt.home.client;

import com.google.gwt.core.client.EntryPoint;
import com.wellsantos.dgwt.home.client.view.FormWidgetsView;
import com.wellsantos.dgwt.home.client.view.HomeView;
import com.wellsantos.dgwt.home.client.view.LoginView;
import com.wellsantos.dgwt.home.client.view.WelcomeView;


public class Home implements EntryPoint {

    
    private static HomeView mainView;
    private static WelcomeView welcomeView;
    private static LoginView loginView;
    private static FormWidgetsView formWidgetsView;

    
    public Home(){
        // creates the initial views
        getMainView();
        getWelcomeView();
    }
    
    
    @Override
    public void onModuleLoad() {
        getMainView().show();
        getWelcomeView().show();
    }
    
    
    public static HomeView getMainView() {
        if (mainView == null){
            mainView = new HomeView();
        }
        return mainView;
    }


    public static WelcomeView getWelcomeView() {
        if (welcomeView == null){
            welcomeView = new WelcomeView();
        }
        return welcomeView;
    }


    public static LoginView getLoginView() {
        if (loginView == null){
            loginView = new LoginView();
        }
        return loginView;
    }


    public static FormWidgetsView getFormWidgetsView() {
        if (formWidgetsView == null){
            formWidgetsView = new FormWidgetsView();
        }
        return formWidgetsView;
    }
}
